/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
$message-sidebar-width: 23rem;

.messages {
  display: flex;
  flex-direction: row;
  @include card();
  height: calc(100vh - 180px);
}

.messages__sidebar {
  // width: $message-sidebar-width;
  width: 100%;
  overflow: hidden;

  @include media-breakpoint-up(md) {
    // 去除右侧边框
    // border-right: 1px solid #f1f1f1;
  }

  @include media-breakpoint-down(md) {
    display: none;
  }

  .listview {
    height: calc(100% - 130px);
    overflow-y: auto;
  }
}

.messages__search {
  padding: 0 2.2rem;
  position: relative;

  .form-group {
    &:before {
      @include font-icon('\f1c3', 1.3rem);
      position: absolute;
      left: 0;
      bottom: 0.35rem;
    }
  }

  .form-control {
    padding-left: 2rem;
  }
}

.messages__body {
  flex: 2;
  flex-direction: column;
  display: flex;
}

.messages__header,
.messages__reply {
  flex: 0 0 auto;
}

.messages__content {
  overflow-y: auto;
  position: relative;
  flex: 1 1 auto;
  padding: 1.5rem;
}

.messages__item {
  display: flex;
  margin-bottom: 2rem;

  &:not(.messages__item--right) {
    flex-direction: row;
  }
}

.messages__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.messages__details {
  padding: 0 1rem 1rem;
  max-width: 500px;

  & > p {
    border-radius: 0.5rem;
    padding: 0.3rem;
    margin-bottom: 0;
    display: inline-block;
    text-align: left;

    & + p {
      margin-top: 2px;
    }
  }

  & > small {
    display: block;
    padding: 0;
    margin-top: 1rem;
    color: $text-muted;
    font-size: 0.9rem;

    & > .zmdi {
      font-size: 1.2rem;
      vertical-align: middle;
      margin-right: 0.3rem;
    }
  }

  &:not(.messages__details--highlight) > p {
    background-color: $gray-lighter;
  }
}

.messages__item--right {
  flex-direction: row-reverse;

  .messages__details {
    text-align: right;

    & > p {
      background-color: $light-blue;
      color: $white;
      margin-left: auto;
    }
  }
}

.messages__reply {
  border-top: 1px solid #f1f1f1;
  padding: 1rem;
  padding-right: 3rem;
  position: relative;
}

.messages__reply__text {
  width: 100%;
  border: 0;
  border-radius: $border-radius;
  padding: 0.5rem;
  resize: none;
}

.messages__reply__btn {
  position: absolute !important;
  top: 1.5rem;
  right: 1.5rem;
}

